package edu.taru.Test;

import javax.servlet.jsp.tagext.*;
import javax.servlet.jsp.*;
import java.io.*;

/**
 * 自定义标签
 * @author wzw
 */
public class TestCustomTag extends TagSupport {
    /**
     * 继承TagSupport类~,重写父类的setPageContext方法，重写父类的doStartTag方法,
     */
    private PageContext pageContext;
    @Override
    public void setPageContext(PageContext pageContext) {
        this.pageContext=pageContext;
    }

    @Override
    public int doStartTag() throws JspException {

        try {
            pageContext.getResponse().getWriter().write("这是我写的一大段信息：ABCDEFGHIJKLMNOPQRSTUVWXYZ");
        } catch (IOException e) {
            e.printStackTrace();
            throw new RuntimeException(e);
        }
        return super.doStartTag();
    }
}
